<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('打印防疫二维码')" />
    <script language="javascript">
	function printdiv(printpage)
	{
		var headstr = "<html><head><title></title></head><body>";
		var footstr = "</body>";
		var newstr = document.all.item(printpage).innerHTML;
		var oldstr = document.body.innerHTML;
		document.body.innerHTML = headstr+newstr+footstr;
		window.print();
		document.body.innerHTML = oldstr;
		return false;
	}
	</script>
	<style type="text/css">
		@page {
		  margin-bottom: 0mm;
		  margin-top: 0mm;
		}
	</style>
</head>
<body style="height:80%">

    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-place-edit" th:object="${fyPlace}">
            <input name="placeId" th:field="*{placeId}" type="hidden">
			<div id="div_print" >
				<div style="text-align:center;margin:50px auto">
					<img th:src="${ctx+'/api/fym/user/noToken/getwxacode2?path=pages/index/index&placeId='+fyPlace.placeId}">
					<div style="margin-top: 40px">    
		                <h1 th:text="*{placeName}">
		            </div>
				</div>
			</div>
            
			<input name="b_print" type="button" class="ipt"   onClick="printdiv('div_print');" value=" 打印 ">
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
    function pagesetup_null() {
        var hkey_root, hkey_path, hkey_key;
        hkey_root = "HKEY_CURRENT_USER";
        hkey_path = "\\Software\\Microsoft\\Internet Explorer\\PageSetup\\";
        try {
          var RegWsh = new ActiveXObject("WScript.Shell");
          hkey_key = "header";
          RegWsh.RegWrite(hkey_root + hkey_path + hkey_key, "");
          hkey_key = "footer";
          RegWsh.RegWrite(hkey_root + hkey_path + hkey_key, "");
        } catch (e) { }
      }
      function getExplorer() {
        var explorer = window.navigator.userAgent;
        //ie
        if (explorer.indexOf("MSIE") >= 0) {
          return "IE";
        }
        //firefox
        else if (explorer.indexOf("Firefox") >= 0) {
          return "Firefox";
        }
        //Chrome
        else if (explorer.indexOf("Chrome") >= 0) {
          return "Chrome";
        }
        //Opera
        else if (explorer.indexOf("Opera") >= 0) {
          return "Opera";
        }
        //Safari
        else if (explorer.indexOf("Safari") >= 0) {
          return "Safari";
        }
      }

      if (getExplorer() == "IE") {
          pagesetup_null();
      }
    </script>
</body>
</html>